#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N = 2e5 + 10;
int pre[N][3];
vector<int>f[N], g[N]; 
pair<int,int> tr[N * 4];
pair<int,int> push_up(pair<int,int> l, pair<int,int> r) {
	if(l.first > r.first) return l;
	return r;
}
void add(int pos, int p, int pl, int pr, pair<int,int> d) {
	if(pl == pr) {
		tr[p] = d;
		return;
	}
	int mid = (pl + pr) / 2;
	if(pos <= mid) add(pos, p * 2, pl, mid, d);
	else add(pos, p * 2 + 1, mid + 1, pr, d);
	tr[p] = push_up(tr[p * 2], tr[p * 2 + 1]);
}
pair<int,int> ask(int L, int R, int p, int pl, int pr) {
	if(L <= pl && pr <= R) return tr[p];
	pair<int,int> res = make_pair(0, 0);
	int mid = (pl + pr) / 2;
	if(L <= mid) res = push_up(res, ask(L, R, p * 2, pl, mid));
	if(R > mid) res = push_up(res, ask(L, R, p * 2 + 1, mid + 1, pr));
	return res;
}
int n, m;
string s, t;
int nxt[N][3];
void solve() {
	int p0 = n + 1, p1 = n + 1;
	for(int i = n; i >= 1; i--) {
		nxt[i][0] = p0;
		nxt[i][1] = p1;
		if(s[i] == '1') p1 = i;
		else p0 = i;
	}
	int j = 0;
	vector<int>ans;
	for(int i = 1; i <= m; i++) {
		if(j + 1 > n) {
			cout << "NO";
			exit(0);
		}
		if(s[j + 1] == t[i]) j = nxt[j + 1][!(t[i] - '0')] - 1;
		else j = nxt[j + 1][t[i] - '0'];
		ans.push_back(j);
	}
	int flag = 0;
	for(int i = j + 2; j <= n; j++) 
		if(s[i] != s[i - 1]) flag = 1;
	if(flag) cout << "NO";
	else {
		cout << "YES\n";
		for(int i = 0; i < m; i++) cout << ans[i] << " ";
	}
}
signed main() {
	freopen("seq.in", "r", stdin);
	freopen("seq.out", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin >> s >> t;
	n = s.size(), m = t.size();
	s = ' ' + s;
	t = ' ' + t;
	int fl = 0;
	for(int i = 2; i <= m; i++) if(t[i] == t[i - 1]) fl = 1;
	if(!fl) {
		solve();
		return 0;
	}
	for(int i = 0; i <= n; i++) {
		for(int j = 0; j <= m + 1; j++) {
			f[i].push_back(0);
			g[i].push_back(0);
		}
	}
	int p0 = 0, p1 = 0;
	for(int i = 1; i <= n; i++) {
		pre[i][0] = p0;
		pre[i][1] = p1;
		if(s[i] == '0') p0 = i;
		else p1 = i;
	}
	f[0][0] = 1;
	add(0, 1, 0, n, make_pair(1, 0));
	for(int j = 1; j <= m; j++) {
		for(int i = 1; i <= n; i++) {
			if(s[i] != t[j]) continue;
			int l = pre[i - 1][!(s[i - 1] - '0')];
			pair<int,int> p = ask(l, i - 1, 1, 0, n);
			f[i][j] = p.first;
			g[i][j] = p.second;
		}
		for(int i = 1; i <= n; i++) add(i, 1, 0, n, make_pair(f[i][j], i));
	}
	int l = pre[n][!(s[n] - '0')];
	int ans = 0, lst = 0;
	for(int i = l; i <= n; i++) {
		ans |= f[i][m];
		if(f[i][m]) lst = i;
	}
	if(ans) {
		cout << "YES\n";
		vector<int>v;
		int now = m;
		while(lst) {
			v.push_back(lst);
			lst = g[lst][now--];
		}
		for(int i = m - 1; i >= 0; i--) cout << v[i] << " ";
	}
	else cout << "NO\n";
	return 0;
}
